;Change the width of a selected set of polylines as a group
;with only one command sequence.
;
;
;	AUTHOR: Henry C. Francis
;		425 N. ASHE ST.
;		SOUTHERN PINES, N.C. 28387
;		All rights reserved without prejudice.
;
;	Copyright:	7-22-91
;	Edited:		7-22-91
;
(defun C:CPLW (/ othlyr nthlyr opw cthlyr gpna gpnl chgpnt lthlyr gpname gpne tch D)
       (SETVAR "CMDECHO" 0)
       (COMMAND "HANDLES" "ON")
       (princ "\nSelect polylines for width change: ")
       (setq gpna (ssget))
       (if gpna (progn
       (setq nthlyr (getreal "Enter width: "))
       (setq lthlyr (getvar "CLAYER"))
       (setq cthlyr "bylayer")
       (setq gpnl 0)
       (setq tch 0)
       (setq gpname (sslength gpna))
       (While (< gpnl gpname)
          (if (= "LINE"
            (cdr (assoc 0 (setq gpne (entget (ssname gpna gpnl))))))
            (progn
               (setq D (cdr (CAR gpne)))
               (command "change" D "" "p" "layer" lthlyr "c" cthlyr "")
               (command "pedit" D "" "w" nthlyr "")

            )
          )
          (if (= "ARC"
            (cdr (assoc 0 (setq gpne (entget (ssname gpna gpnl))))))
            (progn
               (setq D (cdr (CAR gpne)))
               (command "change" D "" "p" "layer" lthlyr "c" cthlyr "")
               (command "pedit" D "" "w" nthlyr "")

            )
          )
          (if (= "POLYLINE"
            (cdr (assoc 0 (setq gpne (entget (ssname gpna gpnl))))))
            (progn
               (setq othlyr (cdr (setq as (assoc 40 gpne))))
               (setq othlyr nthlyr)
               (setq gpne (subst (cons 40 othlyr) as gpne))
               (entmod gpne)
               (setq opw (cdr (setq as (assoc 41 gpne))))
               (setq opw nthlyr)
               (setq gpne (subst (cons 41 opw) as gpne))
               (entmod gpne)
               (setq othlyr (cdr (setq as (assoc 8 gpne))))
               (setq othlyr Lthlyr)
               (setq gpne (subst (cons 8 Lthlyr) as gpne))
               (entmod gpne)
               (setq othlyr (cdr (setq as (assoc 62 gpne))))
               (setq othlyr cthlyr)
               (setq gpne (subst (cons 62 cthlyr) as gpne))

             )
          )
          (setq gpnl (1+ gpnl))
       )
       ))
       (SETQ TCH GPNL)
       (princ "Changed ")(princ tch)(princ " polyline widths.")
       (setq chgpnt nil gpna nil gpnl nil nthlyr nil lthlyr nil othlyr nil)
       (terpri)
)
